//
//  FamilyTreeHomePageVC.m
//  FamilyTree
//
//  Created by student on 16/4/12.
//  Copyright © 2016年 Five. All rights reserved.
//

#import "FamilyTreeHomePageVC.h"

#import "AddPersonVC.h"
@interface FamilyTreeHomePageVC ()

@end

@implementation FamilyTreeHomePageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // 1 左侧按钮
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
    //    UIBarButtonItem *leftItem2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
    self.navigationItem.leftBarButtonItem = leftItem;
    //    self.navigationItem.leftBarButtonItems = @[leftItem,leftItem2];
    
    // 2 中间标题
    //    self.title = [NSString stringWithFormat:@"%i",self.navigationController.viewControllers.count];
    // =>
    //self.navigationItem.title
    //self.tabBarItem.title
    
//    UISegmentedControl *seg = [[UISegmentedControl alloc] initWithItems:@[@"鸡腿",@"大排"]];
//    seg.frame = CGRectMake(0, 0, 100, 30);
//    self.navigationItem.titleView = seg;
    
    // 3 右侧按钮
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:nil action:nil];
    self.navigationItem.rightBarButtonItem = rightItem;

    
    
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
//    NSLog(@"%@",self.navigationController.viewControllers);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

- (IBAction)testAddBtnPressed:(id)sender {
     AddPersonVC *addPersonVC = [[AddPersonVC alloc]init];
    [self.navigationController pushViewController:addPersonVC animated:YES];
}


@end
